extends Button

@export_file("*.tscn","*.tres") var scene_path:String = ""

func _pressed():
	if scene_path.get_file().is_valid_filename():
		if scene_path.ends_with(".tscn"):
			get_tree().change_scene_to_file(scene_path)
			Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
		if scene_path.ends_with(".tres"):
			SaveAndLoad.load_level(scene_path)
